<?php
	require_once "../login/LoginView.php";
	require_once "../login/LoginHandler.php";
	require_once "UploadView.php";
	require_once "UploadHandler.php";
	
	session_start();
	$lv = new LoginView();
	$lh = new LoginHandler();
	$uv = new UploadView();
	$uh = new UploadHandler();
	$title = "Ladda upp filer";
	
	if ($lh->IsLoggedIn()) {
		$body = $lv->DoLogoutBox();
		$body .= $uv->DoUploadBox();
	} else {
		$body = '<p>Inloggning krävs för att ladda upp filer</p>';
	}
	
	if ($uv->TriedToUpload()) {
		$uh->DoUpload();
	}
	
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <title><?php echo $title ?></title>
   <meta http-equiv="content-type" content="text/html; charset=utf-8" />
  </head>
  <body class="">
  	<?php echo $body ?>
  </body>
</html>